/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package com.huawei.aiservice.base;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 登录工厂类
 *
 * @since 2023/10/26 19:38
 */
@Component
public class LoginFactory {
    @Autowired
    private GiteeLogin giteeLogin;

    /**
     * 获取登录方式
     *
     * @param type 登录类型
     * @return Login 登录方式
     */
    public Login createLogin(String type) {
        Login login = null;
        switch (type) {
            case "gitee":
                login = giteeLogin;
                break;
            default:
                login = giteeLogin;
        }
        return login;
    }
}
